-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for i18n docs to lint:linkcheck script #361
Add support for i18n docs to lint:linkcheck script #361
Conversation
|
Name | Link |
---|---|
🔨 Latest commit | 8e8d747 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fantastic @hippotastic!
One thing: the docs repo uses pnpm
so I think you need to remove package-lock.json
and run pnpm i
to update pnpm-lock.yaml
.
Made a couple of suggestions below, but in general looks great!
Thank you for the detailed review and great feedback! I updated my PR to address your valid suggestions. Unfortunately, I found that none of the emojis get displayed correctly in Windows PowerShell and the old terminal, so I replaced them with plain text prefixes and added colors instead to allow faster scanning of the results. I also added a breakdown of the broken link types in the summary as you suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! The plain text solution is actually way better than emojis.
How would you feel about using kleur
instead of chalk
for the terminal colours? It’s already in the transitive dependencies for the repo and is supposed to be smaller/faster than chalk
(with a more or less interchangeable API I believe).
Done. I usually prefer However, as I now know that |
Oh interesting! I'm on Mac and just saw bold rather than bright colours so I guess that explains the potential for confusion. Anyway this looks great! Awesome work! |
@tony-sull Could you please have a look if this can be merged? It's been reviewed by Chris already and I was informed to mention you now. Hope that's alright! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, this is excellent! Big fan of the color coded plaintext output, ran this locally and the output looks excellent and very clear 🥳
This fixes issue #103 by rewriting the broken link check scripts.
Because the previously used
broken-link-checker
package didn't work as expected for multi-language checks and the API docs did not match the actual behavior of the component, I rolled my own link checking logic based on the popularhtmlparser2
library instead.All link checks are now run locally and are based the output of the
astro build
command. The script parses thesitemap.xml
in the build output directory, builds an index of all pages contained in the sitemap, checks for broken links (including invalid URL hashes) and outputs them in an easy-to-use format grouped by page.